package com.vast.admin.api;

import com.vast.admin.api.cietac.config.CietacFeignConfig;
import com.vast.admin.api.cietac.entity.*;
import com.vast.admin.controller.cietac.entity.*;
import com.vast.admin.entity.ArbitrationCase;
import com.vast.admin.entity.ArbitrationProject;
import com.vast.common.core.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 贸仲接口
 */
@FeignClient(url = "${cietac.apiUrl}", name = "cietac", configuration = CietacFeignConfig.class)
public interface CietacApi {

    /**
     * 获取用户信息
     * @param user
     * @return
     */
    @GetMapping("/user/info")
	Result<Object> info(@RequestHeader("User") String user);

    /**
     * 发送注册短信
     * @param mobile
     * @return
     */
    @GetMapping("/external/register/sendSms")
    Result<Object> sendSms(@RequestParam("mobile") String mobile);

    /**
     * 注册
     * @param registInfoEntity
     * @return
     */
    @PostMapping("/external/register")
    Result<String> register(@RequestBody RegistInfoEntity registInfoEntity);

    /**
     * 发送邮箱绑定码
     * @param receiveEmail
     * @return
     */
    @GetMapping("/external/register/sendEmail")
    Result<String> sendEmail(@RequestHeader("User") String user, @RequestParam("receiveEmail") String receiveEmail);

    /**
     * 邮箱绑定
     * @param emailBindEntity
     * @return
     */
    @PostMapping("/external/register/bindEmail")
    Result<String> bindEmail(@RequestHeader("User") String user, @RequestBody EmailBindEntity emailBindEntity);

    /**
     * 获取实名认证二维码
     * @return
     */
    @GetMapping("/external/realname/qrcode")
    Result<String> realNameQRCode(@RequestHeader("User") String user);


    /**
     * 获取实名认证token
     * @return
     */
    @GetMapping("/user/cloudauth/token")
    Result<Object> realNameToken(@RequestHeader("User") String user);

    /**
     * 获取用户认证状态
     * @return
     */
    @GetMapping("/user/cloudauth/status")
    Result<Object> identificationStatus(@RequestHeader("User") String user);
    /**
     * 上传签名图片
     * @return
     */
    @PostMapping(value = "/external/sign", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<Object> uploadSign(@RequestHeader("User") String user, @RequestBody SignPictureMultipartFileParamEntity userCloudauthElectronicSignatureDtoIn);

    /**
     * 获取地区编码
     * @return
     */
    @GetMapping("/external/regionId")
    Result<Object> getRegionId(@RequestHeader("User") String user);

    /**
     * 上传企业信息
     * @return
     */
    @PostMapping(value = "/external/enterprise/info", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<Object> uploadCompanyEntity(@RequestHeader("User")String user, @RequestBody CompanyInfoMultipartFileParamEntity companyEntity);

    /**
     * 获取企业管理员信息
     * @return
     */
    @GetMapping(value = "/user/cloudauth/admin-info")
    Result<Object> getCompanyAdminInfo(@RequestHeader("User")String user);


    /**
     * 添加企业管理员
     * @return
     */
    @PostMapping(value = "/external/enterprise/addAdmin", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<Object> addCompanyAdmin(@RequestHeader("User")String user, @RequestBody CompanyAdminInfoMultipartFileParamEntity companyAdminEntity);

    /**
     * 获取立案说明
     * @param projectId
     * @return
     */
    @GetMapping("/external/case/projectTypeRemark/{projectId}")
    Result<ProjectTypeRemark> getProjectTypeRemark(@PathVariable("projectId") Long projectId);

    /**
     * 立案申请
     * @param submitCase
     * @return
     */
    @PostMapping(value = "/external/case/submitCase")
    Result<CietacLawcaseId> submitCase(@RequestHeader("User")String user, @RequestBody SubmitCase submitCase);

    /**
     * 立项
     * @param createProject
     * @return
     */
    @PostMapping(value = "/external/project/save", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<CietacBackResultId> createProject(@RequestHeader("User")String user, @RequestBody CreateProject createProject);

    /**
     * 获取项目相关基础参数数据
     * @return
     */
    @GetMapping(value = "/external/project/params")
    Result<ProjectDicts> getProjectParams(@RequestHeader("User")String user);

    /**
     * 通过项目id获取项目详情
     * @return
     */
    @GetMapping(value = "/external/project/{projectId}")
    Result<ProjectDetail> getProjectDetailById(@RequestHeader("User")String user,@PathVariable("projectId") Long projectId);
    /**
     * 通过项目id获取项目费用列表
     * @return
     */
    @GetMapping(value = "/external/project/expense/{projectId}")
    Result<Object> getProjectExpenseDetailById(@RequestHeader("User")String user,@PathVariable("projectId") Long projectId, @RequestParam("page") int page, @RequestParam("size")int size);
    /**
     * 提交缴费凭证
     * @return
     */
    @PostMapping(value = "/external/project/expense/pay/{projectId}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Result<Object> submitPaymentVoucher(@RequestHeader("User")String user, @PathVariable("projectId") Long projectId, MultipartFile file);

	/**
	 * 发起仲裁
	 * @param startHandleCase
	 * @param user
	 * @return
	 */
	@PostMapping("/external/case/startHandleCase")
	Result<Void> startHandleCase(@RequestHeader("User")String user, @RequestBody StartHandleCase startHandleCase);

	/**
	 * 获取地区编码
	 * @return
	 */
	@GetMapping("/external/regionId")
	Result<List<BaseRegion>> getBaseRegion();

	/**
	 * 获取案件详情
	 * @param user
	 * @param id
	 * @return
	 */
	@GetMapping("/external/case/detail/{id}")
	Result<CaseInfo> getCaseInfo(@RequestHeader("User")String user, @PathVariable("id") Long id);

	/**
	 * 案件费用支付
	 * @param user
	 * @param id
	 * @return
	 */
	@GetMapping("/external/case/pay/{id}")
	Result<PayResponse> pay(@RequestHeader("User")String user, @PathVariable("id") Long id);


	/**
	 * 文件管理
	 * @param user
	 * @param id
	 * @return
	 */
	@GetMapping("/external/case/file/{id}")
	Result<List<CaseFileResponse>> caseFile(@RequestHeader("User")String user, @PathVariable("id") Long id);


	/**
	 * 补件申请
	 * @param user
	 * @param lawcase_id
	 * @param filename
	 * @param user_complain
	 * @param user_complain_file
	 * @return
	 */
	@PostMapping(value = "/external/case/file/confirm", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	Result<Void> confirmCaseFile(@RequestHeader("User")String user, @RequestParam("lawcase_id") Long lawcase_id, @RequestParam("filename") String filename, @RequestParam("user_complain") String user_complain, @RequestPart("user_complain_file") MultipartFile user_complain_file);


	/**
	 * 补件通知
	 * @param user
	 * @param id
	 * @return
	 */
	@GetMapping("/external/case/notice/{id}")
	Result<List<CaseNoticeResponse>> caseNotice(@RequestHeader("User")String user, @PathVariable("id") Long id);


	/**
	 * 文书管理
	 * @param user
	 * @param id 案件id
	 * @param page
	 * @param size
	 * @return
	 */
	@GetMapping("/external/case/document")
	Result<PageResponse<CaseDocument>> caseDocument(@RequestHeader("User")String user, @RequestParam("lawcase_id") Long id, @RequestParam("page") int page, @RequestParam("size")int size);

	/**
	 * 项目ID获取项目状态
	 * @param projectIds
	 * @return
	 */
	@PostMapping("/external/project/status/ids")
	Result<List<ArbitrationProject>> projectStatus(@RequestBody List<Long> projectIds);

	/**
	 * 案件id获取案件状态
	 * @param caseIds
	 * @return
	 */
	@PostMapping("/external/case/status/ids")
	Result<List<ArbitrationCase>> caseStatus(@RequestBody List<Long> caseIds);

}
